//
// CommonNavTitleView.js
//

import React, { Component } from 'react'
import {
  Text,
  TouchableWithoutFeedback,
  View,
  Image,
} from 'react-native'

export default class  CommonNavTitleView  extends  Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      <View style={{backgroundColor:'#0dc2ca',height:64,flexDirection:'column'}}>
        <View style={{height:20}}></View>
        <View style={{height:44,flexDirection:'row',}}>

            {(!this.props.hideBack||false) && (
              <TouchableWithoutFeedback
                key="left-back"
                onPress={() => this.props.navigation.goBack()}>
                <View style={{width:44,height:44,justifyContent:'center'}}>
                  <Image source={require('./nav_back.png')}/>
                </View>
              </TouchableWithoutFeedback>
            )}

            {(this.props.title||'').length > 0 && (
              <Text
                key='center-title'
                style={{color:'white',alignSelf:'center',flexGrow:1,textAlign:'center',fontSize:18}}>
                  {this.props.title}
              </Text>
            )}

            <View key="right-view" style={{width:44}}/>
        </View>
      </View>
    )
  }
}
